package com.day18.ex01;

import java.io.*;

public class BufferSreamDemo {
    public static void main(String[] args) throws IOException {
        BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("D:\\java\\javaSE\\javaSE\\src\\com\\day18\\ex01\\test.txt"));
        bos.write("hello".getBytes());
        bos.write("\r\n".getBytes());
        bos.close();
        BufferedInputStream bis=new BufferedInputStream(new FileInputStream("D:\\java\\javaSE\\javaSE\\src\\com\\day18\\ex01\\test.txt"));
        byte[] bys=new byte[1024];
        int len;
        while ((len=bis.read(bys))!=-1){
            System.out.println(new String(bys,0,len));
        }
        bis.close();
    }
}
